@prefix-cls: ~'@{namespace}-multiple-tabs';

html[data-theme='dark'] {
  .@{prefix-cls} {
    box-shadow: 0 1px 4px rgb(0 0 0 / 45%);

    .ant-tabs-tab:not(.ant-tabs-tab-active):not(:hover) {
      &::before {
        background-color: @border-color-dark;
      }
    }
  }
}

html[data-theme='light'] {
  .@{prefix-cls} {
    .ant-tabs-tab:not(.ant-tabs-tab-active):not(:hover) {
      &::before {
        background-color: @border-color-light;
      }
    }
  }
}

.@{prefix-cls} {
  z-index: 10;
  height: @multiple-height;
  line-height: @multiple-height;
  background-color: @component-background;
  border-bottom: 0;
  box-shadow: 0 1px 4px rgb(0 21 41 / 8%);

  .ant-tabs-small {
    height: @multiple-height;
  }

  .ant-tabs.ant-tabs-card {
    .ant-tabs-nav {
      height: @multiple-height;
      margin: 0;
      background-color: @component-background;
      border: 0;
      box-shadow: none;

      &::before {
        display: none;
      }

      .ant-tabs-nav-container {
        height: @multiple-height;
      }

      .ant-tabs-tab {
        height: @multiple-height;
        padding-left: 20px;
        padding-right: 20px;
        line-height: @multiple-height;
        color: @text-color-base;
        background-color: @component-background;
        transition: background 0.3s;
        border-radius: 0;
        border: 0;

        &:hover {
          .ant-tabs-tab-remove {
            width: 12px;
          }
        }

        .ant-tabs-tab-remove {
          width: 0;
          height: @multiple-height;
          font-size: 12px;
          color: inherit;
          margin-left: 5px;
          margin-right: -4px;
          padding: 0;
          overflow: hidden;
          transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);

          .anticon-close {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            vertical-align: 2px !important;

            &:hover {
              background: fadeout(@button-error-color, 30%);

              svg {
                fill: @white;
              }
            }
          }

          svg {
            width: 8px;
          }
        }

        svg {
          fill: @text-color-base;
        }
      }

      .ant-tabs-tab:not(.ant-tabs-tab-active) {
        position: relative;

        &:hover {
          background-color: fadeout(@primary-color, 80%);
        }
      }

      .ant-tabs-tab:not(.ant-tabs-tab-active):not(:hover) {
        &::before {
          content: '';
          position: absolute;
          right: 0;
          top: 12px;
          width: 1px;
          height: 16px;
        }
      }

      .ant-tabs-tab-active {
        position: relative;
        padding-left: 18px;
        background: @primary-color;
        border: 0;
        transition: none;

        span {
          color: @white !important;
        }

        .ant-tabs-tab-remove {
          width: 12px;
        }

        svg {
          width: 0.7em;
          fill: @white;
        }
      }
    }

    .ant-tabs-nav > div:nth-child(1) {
      .ant-tabs-tab {
        margin: 0 !important;
      }
    }
  }

  .ant-tabs-tab:not(.ant-tabs-tab-active) {
    .anticon-close {
      font-size: 12px;

      svg {
        width: 0.6em;
      }
    }
  }

  .ant-dropdown-trigger {
    display: inline-flex;
  }

  &--hide-close {
    .ant-tabs-tab-remove {
      width: 0;
    }
  }

  &-content {
    &__extra-quick,
    &__extra-redo,
    &__extra-fold {
      display: inline-block;
      width: @multiple-height;
      height: @multiple-height;
      line-height: @multiple-height;
      color: @text-color-secondary;
      text-align: center;
      cursor: pointer;
      border-left: 1px solid #e5e7eb;

      &:hover {
        color: @text-color-base;
      }

      span[role='img'] {
        transform: rotate(90deg);
      }
    }

    &__extra-redo {
      span[role='img'] {
        transform: rotate(0deg);
      }
    }

    &__info {
      display: inline-block;
      width: 100%;
      height: @multiple-height - 2;
      padding-left: 0;
      // margin-left: -10px;
      font-size: 12px;
      cursor: pointer;
      user-select: none;
    }
  }
}

.ant-tabs-dropdown-menu {
  &-title-content {
    display: flex;
    align-items: center;

    .@{prefix-cls} {
      &-content__info {
        width: auto;
        margin-left: 0;
        line-height: 28px;
      }
    }
  }

  &-item-remove {
    margin-left: auto;
  }
}

.multiple-tabs__dropdown {
  .ant-dropdown-content {
    width: 172px;
  }
}
